1 | import { TOAUTH2AuthContext, FetchData, TFetchActionEvent, TFetchPromise } from '@bearer/functions'
|
2 | // Uncomment the line below to use the API Client
|
3 | // import Client from './client'
|
4 |
|
5 | export default class {{functionClassName}}Function extends FetchData implements FetchData<ReturnedData, any, TOAUTH2AuthContext> {
|
6 | async action(event: TFetchActionEvent<Params, TOAUTH2AuthContext>): TFetchPromise<ReturnedData> {
|
7 | // const token = event.context.auth.accessToken
|
8 | // Put your logic here
|
9 | return { data: [] }
|
10 | }
|
11 |
|
12 | // Uncomment the line below to restrict the function to be called only from a server-side context
|
13 | // static serverSideRestricted = true
|
14 |
|
15 | }
|
16 |
|
17 | /**
|
18 | * Typing
|
19 | */
|
20 | export type Params = {
|
21 | // name: string
|
22 | }
|
23 |
|
24 | export type ReturnedData = {
|
25 | // foo: string[]
|
26 | }
|